3.2.7 \(\int \frac {(a+b \tanh ^{-1}(c x))^2}{(d+c d x)^2} \, dx\) [107]

Optimal. Leaf size=107 \[ -\frac {b^2}{2 c d^2 (1+c x)}+\frac {b^2 \tanh ^{-1}(c x)}{2 c d^2}-\frac {b \left (a+b \tanh ^{-1}(c x)\right )}{c d^2 (1+c x)}+\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{2 c d^2}-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{c d^2 (1+c x)} \]

[Out]

-1/2*b^2/c/d^2/(c*x+1)+1/2*b^2*arctanh(c*x)/c/d^2-b*(a+b*arctanh(c*x))/c/d^2/(c*x+1)+1/2*(a+b*arctanh(c*x))^2/
c/d^2-(a+b*arctanh(c*x))^2/c/d^2/(c*x+1)

________________________________________________________________________________________

Rubi [A]
time = 0.10, antiderivative size = 107, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.316, Rules used = {6065, 6063, 641, 46, 213, 6095} \begin {gather*} -\frac {b \left (a+b \tanh ^{-1}(c x)\right )}{c d^2 (c x+1)}-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{c d^2 (c x+1)}+\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{2 c d^2}-\frac {b^2}{2 c d^2 (c x+1)}+\frac {b^2 \tanh ^{-1}(c x)}{2 c d^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*ArcTanh[c*x])^2/(d + c*d*x)^2,x]

[Out]

-1/2*b^2/(c*d^2*(1 + c*x)) + (b^2*ArcTanh[c*x])/(2*c*d^2) - (b*(a + b*ArcTanh[c*x]))/(c*d^2*(1 + c*x)) + (a +
b*ArcTanh[c*x])^2/(2*c*d^2) - (a + b*ArcTanh[c*x])^2/(c*d^2*(1 + c*x))

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 641

Int[((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[(d + e*x)^(m + p)*(a/d + (c/e)*x)^
p, x] /; FreeQ[{a, c, d, e, m, p}, x] && EqQ[c*d^2 + a*e^2, 0] && (IntegerQ[p] || (GtQ[a, 0] && GtQ[d, 0] && I
ntegerQ[m + p]))

Rule 6063

Int[((a_.) + ArcTanh[(c_.)*(x_)]*(b_.))*((d_) + (e_.)*(x_))^(q_.), x_Symbol] :> Simp[(d + e*x)^(q + 1)*((a + b
*ArcTanh[c*x])/(e*(q + 1))), x] - Dist[b*(c/(e*(q + 1))), Int[(d + e*x)^(q + 1)/(1 - c^2*x^2), x], x] /; FreeQ
[{a, b, c, d, e, q}, x] && NeQ[q, -1]

Rule 6065

Int[((a_.) + ArcTanh[(c_.)*(x_)]*(b_.))^(p_)*((d_) + (e_.)*(x_))^(q_.), x_Symbol] :> Simp[(d + e*x)^(q + 1)*((
a + b*ArcTanh[c*x])^p/(e*(q + 1))), x] - Dist[b*c*(p/(e*(q + 1))), Int[ExpandIntegrand[(a + b*ArcTanh[c*x])^(p
 - 1), (d + e*x)^(q + 1)/(1 - c^2*x^2), x], x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 1] && IntegerQ[q] &
& NeQ[q, -1]

Rule 6095

Int[((a_.) + ArcTanh[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(a + b*ArcTanh[c*x])^(p
 + 1)/(b*c*d*(p + 1)), x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[c^2*d + e, 0] && NeQ[p, -1]

Rubi steps

\begin {align*} \int \frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{(d+c d x)^2} \, dx &=-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{c d^2 (1+c x)}+\frac {(2 b) \int \left (\frac {a+b \tanh ^{-1}(c x)}{2 d (1+c x)^2}-\frac {a+b \tanh ^{-1}(c x)}{2 d \left (-1+c^2 x^2\right )}\right ) \, dx}{d}\\ &=-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{c d^2 (1+c x)}+\frac {b \int \frac {a+b \tanh ^{-1}(c x)}{(1+c x)^2} \, dx}{d^2}-\frac {b \int \frac {a+b \tanh ^{-1}(c x)}{-1+c^2 x^2} \, dx}{d^2}\\ &=-\frac {b \left (a+b \tanh ^{-1}(c x)\right )}{c d^2 (1+c x)}+\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{2 c d^2}-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{c d^2 (1+c x)}+\frac {b^2 \int \frac {1}{(1+c x) \left (1-c^2 x^2\right )} \, dx}{d^2}\\ &=-\frac {b \left (a+b \tanh ^{-1}(c x)\right )}{c d^2 (1+c x)}+\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{2 c d^2}-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{c d^2 (1+c x)}+\frac {b^2 \int \frac {1}{(1-c x) (1+c x)^2} \, dx}{d^2}\\ &=-\frac {b \left (a+b \tanh ^{-1}(c x)\right )}{c d^2 (1+c x)}+\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{2 c d^2}-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{c d^2 (1+c x)}+\frac {b^2 \int \left (\frac {1}{2 (1+c x)^2}-\frac {1}{2 \left (-1+c^2 x^2\right )}\right ) \, dx}{d^2}\\ &=-\frac {b^2}{2 c d^2 (1+c x)}-\frac {b \left (a+b \tanh ^{-1}(c x)\right )}{c d^2 (1+c x)}+\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{2 c d^2}-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{c d^2 (1+c x)}-\frac {b^2 \int \frac {1}{-1+c^2 x^2} \, dx}{2 d^2}\\ &=-\frac {b^2}{2 c d^2 (1+c x)}+\frac {b^2 \tanh ^{-1}(c x)}{2 c d^2}-\frac {b \left (a+b \tanh ^{-1}(c x)\right )}{c d^2 (1+c x)}+\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{2 c d^2}-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{c d^2 (1+c x)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.07, size = 124, normalized size = 1.16 \begin {gather*} \frac {-4 a^2-4 a b-2 b^2-4 b (2 a+b) \tanh ^{-1}(c x)+2 b^2 (-1+c x) \tanh ^{-1}(c x)^2-b (2 a+b) (1+c x) \log (1-c x)+2 a b \log (1+c x)+b^2 \log (1+c x)+2 a b c x \log (1+c x)+b^2 c x \log (1+c x)}{4 c d^2 (1+c x)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*ArcTanh[c*x])^2/(d + c*d*x)^2,x]

[Out]

(-4*a^2 - 4*a*b - 2*b^2 - 4*b*(2*a + b)*ArcTanh[c*x] + 2*b^2*(-1 + c*x)*ArcTanh[c*x]^2 - b*(2*a + b)*(1 + c*x)
*Log[1 - c*x] + 2*a*b*Log[1 + c*x] + b^2*Log[1 + c*x] + 2*a*b*c*x*Log[1 + c*x] + b^2*c*x*Log[1 + c*x])/(4*c*d^
2*(1 + c*x))

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(293\) vs. \(2(101)=202\).
time = 0.30, size = 294, normalized size = 2.75

method result size
risch \(\frac {b^{2} \left (c x -1\right ) \ln \left (c x +1\right )^{2}}{8 d^{2} \left (c x +1\right ) c}-\frac {b \left (b c x \ln \left (-c x +1\right )-b \ln \left (-c x +1\right )+4 a +2 b \right ) \ln \left (c x +1\right )}{4 d^{2} \left (c x +1\right ) c}+\frac {b^{2} c x \ln \left (-c x +1\right )^{2}+4 \ln \left (-c x -1\right ) a b c x +2 \ln \left (-c x -1\right ) b^{2} c x -4 \ln \left (c x -1\right ) a b c x -2 \ln \left (c x -1\right ) b^{2} c x -b^{2} \ln \left (-c x +1\right )^{2}+4 \ln \left (-c x -1\right ) a b +2 b^{2} \ln \left (-c x -1\right )-4 a b \ln \left (c x -1\right )-2 b^{2} \ln \left (c x -1\right )+8 b \ln \left (-c x +1\right ) a +4 b^{2} \ln \left (-c x +1\right )-8 a^{2}-8 a b -4 b^{2}}{8 d^{2} \left (c x +1\right ) c}\) \(261\)
derivativedivides \(\frac {-\frac {a^{2}}{d^{2} \left (c x +1\right )}-\frac {b^{2} \arctanh \left (c x \right )^{2}}{d^{2} \left (c x +1\right )}-\frac {b^{2} \arctanh \left (c x \right ) \ln \left (c x -1\right )}{2 d^{2}}-\frac {b^{2} \arctanh \left (c x \right )}{d^{2} \left (c x +1\right )}+\frac {b^{2} \arctanh \left (c x \right ) \ln \left (c x +1\right )}{2 d^{2}}+\frac {b^{2} \ln \left (c x -1\right ) \ln \left (\frac {c x}{2}+\frac {1}{2}\right )}{4 d^{2}}-\frac {b^{2} \ln \left (c x -1\right )^{2}}{8 d^{2}}-\frac {b^{2} \ln \left (c x -1\right )}{4 d^{2}}-\frac {b^{2}}{2 d^{2} \left (c x +1\right )}+\frac {b^{2} \ln \left (c x +1\right )}{4 d^{2}}-\frac {b^{2} \ln \left (-\frac {c x}{2}+\frac {1}{2}\right ) \ln \left (\frac {c x}{2}+\frac {1}{2}\right )}{4 d^{2}}+\frac {b^{2} \ln \left (-\frac {c x}{2}+\frac {1}{2}\right ) \ln \left (c x +1\right )}{4 d^{2}}-\frac {b^{2} \ln \left (c x +1\right )^{2}}{8 d^{2}}-\frac {2 a b \arctanh \left (c x \right )}{d^{2} \left (c x +1\right )}-\frac {a b \ln \left (c x -1\right )}{2 d^{2}}-\frac {a b}{d^{2} \left (c x +1\right )}+\frac {a b \ln \left (c x +1\right )}{2 d^{2}}}{c}\) \(294\)
default \(\frac {-\frac {a^{2}}{d^{2} \left (c x +1\right )}-\frac {b^{2} \arctanh \left (c x \right )^{2}}{d^{2} \left (c x +1\right )}-\frac {b^{2} \arctanh \left (c x \right ) \ln \left (c x -1\right )}{2 d^{2}}-\frac {b^{2} \arctanh \left (c x \right )}{d^{2} \left (c x +1\right )}+\frac {b^{2} \arctanh \left (c x \right ) \ln \left (c x +1\right )}{2 d^{2}}+\frac {b^{2} \ln \left (c x -1\right ) \ln \left (\frac {c x}{2}+\frac {1}{2}\right )}{4 d^{2}}-\frac {b^{2} \ln \left (c x -1\right )^{2}}{8 d^{2}}-\frac {b^{2} \ln \left (c x -1\right )}{4 d^{2}}-\frac {b^{2}}{2 d^{2} \left (c x +1\right )}+\frac {b^{2} \ln \left (c x +1\right )}{4 d^{2}}-\frac {b^{2} \ln \left (-\frac {c x}{2}+\frac {1}{2}\right ) \ln \left (\frac {c x}{2}+\frac {1}{2}\right )}{4 d^{2}}+\frac {b^{2} \ln \left (-\frac {c x}{2}+\frac {1}{2}\right ) \ln \left (c x +1\right )}{4 d^{2}}-\frac {b^{2} \ln \left (c x +1\right )^{2}}{8 d^{2}}-\frac {2 a b \arctanh \left (c x \right )}{d^{2} \left (c x +1\right )}-\frac {a b \ln \left (c x -1\right )}{2 d^{2}}-\frac {a b}{d^{2} \left (c x +1\right )}+\frac {a b \ln \left (c x +1\right )}{2 d^{2}}}{c}\) \(294\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*arctanh(c*x))^2/(c*d*x+d)^2,x,method=_RETURNVERBOSE)

[Out]

1/c*(-a^2/d^2/(c*x+1)-b^2/d^2*arctanh(c*x)^2/(c*x+1)-1/2*b^2/d^2*arctanh(c*x)*ln(c*x-1)-b^2/d^2*arctanh(c*x)/(
c*x+1)+1/2*b^2/d^2*arctanh(c*x)*ln(c*x+1)+1/4*b^2/d^2*ln(c*x-1)*ln(1/2*c*x+1/2)-1/8*b^2/d^2*ln(c*x-1)^2-1/4*b^
2/d^2*ln(c*x-1)-1/2*b^2/d^2/(c*x+1)+1/4*b^2/d^2*ln(c*x+1)-1/4*b^2/d^2*ln(-1/2*c*x+1/2)*ln(1/2*c*x+1/2)+1/4*b^2
/d^2*ln(-1/2*c*x+1/2)*ln(c*x+1)-1/8*b^2/d^2*ln(c*x+1)^2-2*a*b/d^2*arctanh(c*x)/(c*x+1)-1/2*a*b/d^2*ln(c*x-1)-a
*b/d^2/(c*x+1)+1/2*a*b/d^2*ln(c*x+1))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 277 vs. \(2 (101) = 202\).
time = 0.27, size = 277, normalized size = 2.59 \begin {gather*} -\frac {1}{2} \, {\left (c {\left (\frac {2}{c^{3} d^{2} x + c^{2} d^{2}} - \frac {\log \left (c x + 1\right )}{c^{2} d^{2}} + \frac {\log \left (c x - 1\right )}{c^{2} d^{2}}\right )} + \frac {4 \, \operatorname {artanh}\left (c x\right )}{c^{2} d^{2} x + c d^{2}}\right )} a b - \frac {1}{8} \, {\left (4 \, c {\left (\frac {2}{c^{3} d^{2} x + c^{2} d^{2}} - \frac {\log \left (c x + 1\right )}{c^{2} d^{2}} + \frac {\log \left (c x - 1\right )}{c^{2} d^{2}}\right )} \operatorname {artanh}\left (c x\right ) + \frac {{\left ({\left (c x + 1\right )} \log \left (c x + 1\right )^{2} + {\left (c x + 1\right )} \log \left (c x - 1\right )^{2} - 2 \, {\left (c x + {\left (c x + 1\right )} \log \left (c x - 1\right ) + 1\right )} \log \left (c x + 1\right ) + 2 \, {\left (c x + 1\right )} \log \left (c x - 1\right ) + 4\right )} c^{2}}{c^{4} d^{2} x + c^{3} d^{2}}\right )} b^{2} - \frac {b^{2} \operatorname {artanh}\left (c x\right )^{2}}{c^{2} d^{2} x + c d^{2}} - \frac {a^{2}}{c^{2} d^{2} x + c d^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*arctanh(c*x))^2/(c*d*x+d)^2,x, algorithm="maxima")

[Out]

-1/2*(c*(2/(c^3*d^2*x + c^2*d^2) - log(c*x + 1)/(c^2*d^2) + log(c*x - 1)/(c^2*d^2)) + 4*arctanh(c*x)/(c^2*d^2*
x + c*d^2))*a*b - 1/8*(4*c*(2/(c^3*d^2*x + c^2*d^2) - log(c*x + 1)/(c^2*d^2) + log(c*x - 1)/(c^2*d^2))*arctanh
(c*x) + ((c*x + 1)*log(c*x + 1)^2 + (c*x + 1)*log(c*x - 1)^2 - 2*(c*x + (c*x + 1)*log(c*x - 1) + 1)*log(c*x +
1) + 2*(c*x + 1)*log(c*x - 1) + 4)*c^2/(c^4*d^2*x + c^3*d^2))*b^2 - b^2*arctanh(c*x)^2/(c^2*d^2*x + c*d^2) - a
^2/(c^2*d^2*x + c*d^2)

________________________________________________________________________________________

Fricas [A]
time = 0.34, size = 101, normalized size = 0.94 \begin {gather*} \frac {{\left (b^{2} c x - b^{2}\right )} \log \left (-\frac {c x + 1}{c x - 1}\right )^{2} - 8 \, a^{2} - 8 \, a b - 4 \, b^{2} + 2 \, {\left ({\left (2 \, a b + b^{2}\right )} c x - 2 \, a b - b^{2}\right )} \log \left (-\frac {c x + 1}{c x - 1}\right )}{8 \, {\left (c^{2} d^{2} x + c d^{2}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*arctanh(c*x))^2/(c*d*x+d)^2,x, algorithm="fricas")

[Out]

1/8*((b^2*c*x - b^2)*log(-(c*x + 1)/(c*x - 1))^2 - 8*a^2 - 8*a*b - 4*b^2 + 2*((2*a*b + b^2)*c*x - 2*a*b - b^2)
*log(-(c*x + 1)/(c*x - 1)))/(c^2*d^2*x + c*d^2)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {a^{2}}{c^{2} x^{2} + 2 c x + 1}\, dx + \int \frac {b^{2} \operatorname {atanh}^{2}{\left (c x \right )}}{c^{2} x^{2} + 2 c x + 1}\, dx + \int \frac {2 a b \operatorname {atanh}{\left (c x \right )}}{c^{2} x^{2} + 2 c x + 1}\, dx}{d^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*atanh(c*x))**2/(c*d*x+d)**2,x)

[Out]

(Integral(a**2/(c**2*x**2 + 2*c*x + 1), x) + Integral(b**2*atanh(c*x)**2/(c**2*x**2 + 2*c*x + 1), x) + Integra
l(2*a*b*atanh(c*x)/(c**2*x**2 + 2*c*x + 1), x))/d**2

________________________________________________________________________________________

Giac [A]
time = 0.40, size = 119, normalized size = 1.11 \begin {gather*} \frac {1}{8} \, c {\left (\frac {{\left (c x - 1\right )} b^{2} \log \left (-\frac {c x + 1}{c x - 1}\right )^{2}}{{\left (c x + 1\right )} c^{2} d^{2}} + \frac {2 \, {\left (2 \, a b + b^{2}\right )} {\left (c x - 1\right )} \log \left (-\frac {c x + 1}{c x - 1}\right )}{{\left (c x + 1\right )} c^{2} d^{2}} + \frac {2 \, {\left (2 \, a^{2} + 2 \, a b + b^{2}\right )} {\left (c x - 1\right )}}{{\left (c x + 1\right )} c^{2} d^{2}}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*arctanh(c*x))^2/(c*d*x+d)^2,x, algorithm="giac")

[Out]

1/8*c*((c*x - 1)*b^2*log(-(c*x + 1)/(c*x - 1))^2/((c*x + 1)*c^2*d^2) + 2*(2*a*b + b^2)*(c*x - 1)*log(-(c*x + 1
)/(c*x - 1))/((c*x + 1)*c^2*d^2) + 2*(2*a^2 + 2*a*b + b^2)*(c*x - 1)/((c*x + 1)*c^2*d^2))

________________________________________________________________________________________

Mupad [B]
time = 1.25, size = 97, normalized size = 0.91 \begin {gather*} \frac {b^2\,{\mathrm {atanh}\left (c\,x\right )}^2+b^2\,\mathrm {atanh}\left (c\,x\right )+2\,a\,b\,\mathrm {atanh}\left (c\,x\right )}{2\,c\,d^2}-\frac {2\,a^2+4\,a\,b\,\mathrm {atanh}\left (c\,x\right )+2\,a\,b+2\,b^2\,{\mathrm {atanh}\left (c\,x\right )}^2+2\,b^2\,\mathrm {atanh}\left (c\,x\right )+b^2}{2\,x\,c^2\,d^2+2\,c\,d^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*atanh(c*x))^2/(d + c*d*x)^2,x)

[Out]

(b^2*atanh(c*x)^2 + b^2*atanh(c*x) + 2*a*b*atanh(c*x))/(2*c*d^2) - (2*b^2*atanh(c*x)^2 + 2*a*b + 2*b^2*atanh(c
*x) + 2*a^2 + b^2 + 4*a*b*atanh(c*x))/(2*c*d^2 + 2*c^2*d^2*x)

________________________________________________________________________________________